package com.wankuma.hcm.midlet.metwit;
import java.util.Calendar;

public class CalenderUtil {
	public static String calenderToString(Calendar cal) {
		String strWday = null;
		switch (cal.get(Calendar.DAY_OF_WEEK)) {
		case 1:
			strWday = "Sun";
			break;
		case 2:
			strWday = "Mon";
			break;
		case 3:
			strWday = "Tue";
			break;
		case 4:
			strWday = "Wed";
			break;
		case 5:
			strWday = "Thu";
			break;
		case 6:
			strWday = "Fri";
			break;
		case 7:
			strWday = "Sat";
			break;
		}

		String strMonth = null;
		switch (cal.get(Calendar.MONTH)) {
		case 1:
			strMonth = "Jan";
			break;
		case 2:
			strMonth = "Feb";
			break;
		case 3:
			strMonth = "Mar";
			break;
		case 4:
			strMonth = "Apr";
			break;
		case 5:
			strMonth = "May";
			break;
		case 6:
			strMonth = "Jun";
			break;
		case 7:
			strMonth = "Jul";
			break;
		case 8:
			strMonth = "Aug";
			break;
		case 9:
			strMonth = "Sep";
			break;
		case 10:
			strMonth = "Oct";
			break;
		case 11:
			strMonth = "Nov";
			break;
		case 12:
			strMonth = "Dec";
			break;
		}

		String str = strWday + ", "
				+ new Integer(cal.get(Calendar.DAY_OF_MONTH)).toString() + " "
				+ strMonth + " "
				+ new Integer(cal.get(Calendar.YEAR)).toString() + " "
				+ new Integer(cal.get(Calendar.HOUR)).toString() + ":"
				+ new Integer(cal.get(Calendar.MINUTE)).toString() + ":"
				+ new Integer(cal.get(Calendar.SECOND)).toString() + " GMT";
		return str;
	}
}
